import datetime
from applications.extensions import db

class Challenge(db.Model):
    __tablename__ = 'app_challenge'
    id = db.Column(db.Integer, primary_key=True, comment='分类ID')
    question = db.Column(db.String(255), comment='问题')
    answer = db.Column(db.String(255), comment='答案')
    option_type = db.Column(db.String(255), comment='单选还是多选')
    options = db.Column(db.String(255), comment='选项')
    explain = db.Column(db.String(255), comment='解释')
    tag = db.Column(db.String(255), comment='标签')
    sort = db.Column(db.Integer, comment='排序')
    create_time = db.Column(db.DateTime, default=datetime.datetime.now, comment='创建时间')



# CREATE TABLE app_challenge (
#         id INTEGER NOT NULL COMMENT '用户ID' AUTO_INCREMENT,
#         question VARCHAR(255) COMMENT '问题',
#         answer VARCHAR(255) COMMENT '答案',
#         option_type VARCHAR(20) COMMENT '单选还是多选',
#         `options` VARCHAR(20) COMMENT '选项',
#         `explain` VARCHAR(255) COMMENT '解释',
#         tag VARCHAR(255) COMMENT '标签',
#         sort INTEGER COMMENT '排序',
#         create_time DATETIME COMMENT '创建时间',
#         PRIMARY KEY (id)
# )
